package com.itheima.utils;

public class BaseContext {

    //1. 创建ThreadLocal对象
    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    //2. 暴露一个方法，往ThreadLocal里面存数据
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }

    //3. 暴露一个方法，从ThreadLocal里面取数据
    public static Long getCurrentId(){
        return threadLocal.get();
    }

}
